package com.zhxs.nfcscan;


import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.zhxs.nfcscan.view.CardTestActivity;
import com.zhxs.utils.LogUtil;

/**
 * Created by sunrui on 2019/4/28.
 */

public class BootBroadcastReceiver extends BroadcastReceiver {
    static final String ACTION = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(ACTION)) {
            LogUtil.e("收到开机的BroadcastReceiver");

            Intent mainActivityIntent = new Intent(context, LogicActivity.class);  // 要启动的Activity
            mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(mainActivityIntent);
            LogUtil.e("开机启动了接收到了");

        }
    }
}
